﻿using System;
using System.Windows.Forms;

namespace WINBASE
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>

        [STAThread]
        static void Main()
        {
            //ToolStripManager.Renderer = new Office2007Renderer();
            Application.ApplicationExit += Application_ApplicationExit;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //User Login
            Application.Run(ApplicationObject.FrmLogin);

            //Initialize Database
            //WLCGlobalData.InitializeData(WLCGlobalObject.FrmLogin.DBConnection.ConnectionString);

            //Initialize User Interface
            ApplicationObject.InitializeObject();

            //Startup Point
            //if (System.Diagnostics.Debugger.IsAttached)
            //{
            //    Application.Run(WLCGlobalObject.FrmMain);
            //    //Application.Run(new VirtualJustInTimeDemo());
            //}
            //else Application.Run(WLCGlobalObject.FrmLogin);
        }

        static void Application_ApplicationExit(object sender, EventArgs e)
        {
            ApplicationService.QueryHelper.ExecSql("UPDATE rclh1 SET StatusCode = @s WHERE TrxNo = @s", "LOT", ApplicationData.LoginTrxNo);
        }
    }
}